package com.example.models;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Objects;
@Data
@NoArgsConstructor//无参构造
@AllArgsConstructor//全参构造
public class ResultList {
    private Integer code;
    private String msg;
    private Object data;
    public static ResultList success() {
        return new ResultList(200,"Success",null);
    }

    public static ResultList success(Object data) {
        return new ResultList(200,"Success",data);
    }

    public static ResultList success(String data){ return new ResultList(200,"success",data);};
    public static ResultList error(String msg) {
        return new ResultList(500,msg,null);
    }
    public static ResultList error(Integer code,String msg){
        return  new ResultList(code,msg,null);
    }
}
